package com.yun.util.yun.leetCode.simple;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 移除元素
 */
public class RmElement {

    public int removeElement(int[] nums, int val) {

        List<Integer> list = Arrays.stream(nums).boxed().collect(Collectors.toList());
        list.removeIf(next -> next == val);
        System.out.println(list);
        return list.size();
    }

    public static void main(String[] args) {
        int[] a = {3,2,2,3};
        int b = 3;
        RmElement element = new RmElement();
        int i = element.removeElement(a, b);
        System.out.println(i);
    }
}
//0 <= nums.length <= 100
//0 <= nums[i] <= 50
//0 <= val <= 100